package com.lt.experiment01;

/**
 * @author LT
 * @PackageName com.lt.experiment01
 * @ClassName Context
 * @Description
 * @date 2021/9/18 21:37
 * @since
 */
public class Context {
    private Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    public static void main(String[] args) {
        Context context1 = new Context(new ConcreteStrategyA());
        Context context2 = new Context(new ConcreteStrategyB());
        Context context3 = new Context(new ConcreteStrategyC());
        context1.strategy.AlgorithmInterface();
        context2.strategy.AlgorithmInterface();
        context3.strategy.AlgorithmInterface();
    }
}
